[SUBROUTINE]
version = 1.14
icon = drill-single.png
name = _("Drill Single")
type = drill-one
help = _("<b>Drill a Single hole</b>")
order = act fcut h1 x y h3 s u_s ugc dpt u_dpt ugcd

[PARAM_ACT]
name = _("Active")
icon = enable.png
type = bool
value = 1

[PARAM_FCUT]
name = _("Show design")
icon = glasses.png
type = bool
value = 1

[PARAM_H1]
name = _("Coords")
type = sub-header

[PARAM_X]
name = _("X")
type = float
icon = x.png
tool_tip = _("X coordinate")
value = 0
metric_value = 0.0
header = h1

[PARAM_Y]
name = _("Y")
type = float
icon = y.png
tool_tip = _("Y coordinate")
value = 0
metric_value = 0.0
header = h1

[PARAM_H3]
name = _("Drilling")
type = sub-header

[PARAM_S]
name = _("Drill start")
type = combo-user
options = _("User defined=0:Surface=1:Half=2:One quarter=3:Three quarter=4:G-Code=5")
icon = drill-start.png
tool_tip = _("Pre or user defined")
value = 1
header = h3
links = u_s=0:ugc=5

[PARAM_U_S]
name = _("User start")
type = float
value = 0.0
metric_value = 0.0
header = h3
hidden = 1

[PARAM_UGC]
name = User gcode
type = gcode
value = 
header = h3
hidden = 1

[PARAM_UGCD]
name = User depth gcode
type = gcode
value =
header = h3
hidden = 1

[PARAM_DPT]
name = _("Drill down to")
type = combo-user
options = _("User defined=0:Through=1:Center drill depth=2:Bottom=3:Half=4:One quarter=5:Three quarter=6:G-Code=7")
icon = drill-end.png
tool_tip = _("Pre or user defined")
value = 1
header = h3
links = u_dpt=0:ugcd=7

[PARAM_U_DPT]
name = _("User depth")
type = float
value = -0.5
metric_value = -12.0
header = h3
hidden = 1

[DEFINITIONS]
content =
;	<eval>self.include_once(file name here)</eval>

[CALL]
content =
	(begin #sub_name)
	(drill a single hole author : Fernand Veilleux)
	
	o<#self_id_active> if [#param_act AND [#<_tool_usage> EQ 3]] (if active)
		o<select> CALL [31] [#param_s] [#param_u_s] [#<surface>] [#<surface> - #<wp_depth> / 2] [#<surface> - #<wp_depth> / 4] [#<bottom> + #<wp_depth> / 4] [#param_ugc]
		o<select> CALL [32] [#param_dpt] [#param_u_dpt] [#<bottom_through>] [#<surface> + #<center_drill_depth>] [#<bottom>] [#<surface> - #<wp_depth> / 2] [#<surface> - #<wp_depth> / 4] [#<bottom> + #<wp_depth> / 4] [#param_ugcd]
	
		o<set_spindle_rpm> CALL [#<_drill_rpm>] [#<_drill_feed>]
	
		o<drill_single> CALL [#param_x] [#param_y] [#31] [#32] [#<drill_diameter>] [#<drill_point_len>] [#param_fcut]
		
		o<#self_id_stop> if [#<_spindle_all_time> EQ 0]
			M9 M5
		o<#self_id_stop> endif
		
	o<#self_id_active> endif
	(end #sub_name)
